# Overview

This folder contains all of the data and code necessary to replicate the main results of "Longer Trips to Court Cause Evictions" by David A. Hoffman and Anton Strezhnev. The primary dataset consists of eviction filings in Philadelphia Municipal Court from 2005 to 2021 obtained from Philadelphia Legal Assistance. The specific names of the plaintiffs and defendants as well as the precise addresses have been removed. Names of landlords from the linked data from Pew Charitable Trusts have also been removed.

# Description of the files in the archive

`philly_evictions_analysis.R` - Primary R script

`stat_binscatter.R` - Auxiliary script for generating binned scatterplots with quantile bins. Originally written by Maximilian Eber. Original source: https://github.com/maximilianeber/binscatter 

## Data

`summary_table_philadelphia.csv` - Primary data file. Contains 232,533 eviction proceedings in Philadelphia Municipal Court from 2005 to 2021 (obtained from Philadelphia Legal Assistance) merged with data provided by Pew Charitable Trusts on property characteristics and ultimate ownership, Google Maps geolocation data, and Google Maps DistanceMatrix API estimates of the commuting time from the plaintiff's property to the Philadelphia Municipal Courthouse. Complete description of all variable names below. Note that due to changes in the content of the landlord-tenant complaint form over time, some fields in the LT-complaint will only appear in later years.

`docket_defendant_outcomes.csv` - Secondary data file. Contains summaries of case outcomes at the level of the defendant extracted directly from each case's docket entry. Complete description of all variable names below. Note that not all cases in `docket_defendant_outcomes.csv` appear in `summary_table_philadelphia.csv` as the latter contains only those cases that pass through initial pre-processing (e.g. have identifiable addresses).

`pew_summary.csv` - Supplementary data file for Appendix 1. Contains tract-level counts of unique properties from the Pew dataset on Philadelphia rental properties and the number of these properties that appear in the evictions dataset.

`Census Tracts` - Folder containing the shapefiles for the 2010 Census Tracts.

`Census Block` - Folder containing the shapefiles for the 2010 Census Blocks

`ACS/Block/2010_block_race.csv` - U.S. Census (2010) block-level racial demographic data (from table ID: DECENNIALPL2010.P1)

`ACS/Block/2010_block_hispanic.csv` - U.S. Census (2010) block-level data on hispanic/latino  (from table ID: DECENNIALPL2010.P2)

`ACS/Tract/acs_income.csv` - 2011-2015 American Community Survey 5-Year Estimates for Income in the past 12 months (Table ID: ACSST5Y2015.S1901)

`ACS/Tract/acs_housing.csv` - 2011-2015 American Community Survey 5-Year Estimates for housing characteristics (Table ID: ACSDP5Y2015.DP04)

`ACS/Tract/acs_race.csv` - 2011-2015 American Community Survey 5-Year Estimates for demographic data (Table ID: ACSDP5Y2015.DP05)

`ACS/Tract/acs_contractRent.csv` - 2011-2015 American Community Survey 5-Year Estimates for median contract rent (Table ID: ACSDT5Y2015.B25058)

# Description of variables in `summary_table_philadelphia.csv`

232,533 Observations. 63 variables. 

- `d_filing`: Date case filed
- `commercial`: Is this identified as a commercial property?
- `nonresidential`: Is this identified as a non-residential property?
- `publichousing`: Is this a Philadelphia Housing Association property?
- `plaintiff_represented`: Does the plaintiff have a lawyer present?
- `defendant_represented`: Does the defendant have a lawyer present?
- `first_date_heard`, `second_date_heard`, `third_date_heard`, `last_date_heard`: First, second, third and last date of hearings
- `complaint_fee`: Cost of filing the complaint
- `award_total_amount_due`, `award_in_the_amount_of`, `award_costs`, `award_other_fees`, `award_phyiscal_damages`: Amount awarded by court (total, amount, costs, other fees, physical damages)
- `amt_sought`: Full amount sought by landlord - from the landlord-tenant complaint
- `total_rent`: Total rent sought by landlord - from the landlord-tenant complaint
- `ongoing_rent`: Ongoing (monthly) rent sought by landlord - from the landlord-tenant complaint
- `utilities`, `attorney_fees`, `physical_damage`, `other_fees`, `court_costs`, `gas`, `electric`, `water_sewer`, `late_fees`: Other itemized amounts of damages sought by landlord - from the landlord-tenant complaint
- `possession_sought`: Landlord seeks a judgment for possession - from the landlord-tenant complaint
- `money_judgment_sought`: Landlord seeks a money judgment - from the landlord-tenant complaint
- `lease_start`: Starting date of the lease - from the landlord-tenant complaint
- `lease_type`: Type of lease (e.g. written, verbal) - from the landlord-tenant complaint
- `lease_term`: Term of the lease - from the landlord-tenant complaint
- `fitness`: Landlord declares that the premises is fit for its purpose - from the landlord-tenant complaint
- `unaware`: The landlord states that they are unaware of any open notices by the Department of Licenses and Inspections alledging violations of the Philadelphia Code - from the landlord-tenant complaint
- `noncompliance`: The landlord is not in compliance with the requirements to provide a certificate of rental suitability or have a rental license - from the landlord-tenant complaint
- `refuses_to_surrender`: The landlord states that the tenant refuses to surrender the property - from the landlord-tenant complaint
- `date_of_notice_to_vacate`: Date landlord issued notice to vacate - from the landlord-tenant complaint
- `vacate_by_date`: Date by which tenant was expected to vacate - from the landlord-tenant complaint
- `waiver_of_notice_to_vacate`: Did the tenant waive the right to a notice to vacate in their lease? - from the landlord-tenant complaint
- `lead_certification_provided`: Did the landlord provide tenant a lead-free certification form? - from the landlord-tenant complaint
- `lead_property_old`: Was the property built before March of 1978 - from the landlord-tenant complaint (note that all of these fields related to lead certification are very recent additions to the form so exhibit little variation in this dataset)
- `lead_lease_old`: Was the lease effective prior to December 21, 2012 (for lead certification purposes) - from the landlord-tenant complaint
- `lead_subsidized`: Is this a PHA property or a subsidized lease? - from the landlord-tenant complaint
- `rental_license_expiration_date`: Date landlord's rental license expires - from the landlord-tenant complaint
- `rental_license_effective_date`: Effective date of landlord's rental license - from the landlord-tenant complaint
- `bld_typ`: Type of building (from Pew dataset)
    - 1                      Row
    - 2            Semi-Detached
    - 3                 Detached
    - 4 Single Family Conversion
    - 5                mixed use
    - 6      2-4 unit apartments
    - 7     5-50 unit apartments
    - 8      51+ unit apartments
    - 9          Boarding/Hotels
    - 10               Commercial
    - 11               Industrial
    - 12              Vacant Land
    - 13           Public Housing
    - 14              Condominium
- `transit_distance`: Public transit distance from property to courthouse returned by DistanceMatrix API (in meters)
- `transit_duration`: Public transit duration from property to courthouse returned by DistanceMatrix API (in seconds)
- `search_status_transit`: Status of the Google DistanceMatrix API query for transit
- `driving_distance`: Driving distance from property to courthouse returned by DistanceMatrix API (in meters)
- `driving_duration`: Driving duration from property to courthouse returned by DistanceMatrix API (in seconds)
- `search_status_driving`: Status of the Google DistanceMatrix API query for driving
- `transit_distance_weekend`: Public transit distance from property to courthouse returned by DistanceMatrix API (in meters) - measured on a weekend
- `transit_duration_weekend`: Public transit duration from property to courthouse returned by DistanceMatrix API (in seconds) - measured on a weekend
- `search_status_transit_weekend`: Status of the Google DistanceMatrix API query for weekend transit
- `weekend_gap`: Gap between public transit duration on weekday v. weekend.
- `google_latitude`: Latitude of property (from Google Geolocation API)
- `google_longitude`: Longitude of property (from Google Geolocation API)
- `status`: Status of the Google Geolocation API query
- `id`: Unique identifier for each case (randomly generated via `uuid::UUIDgenerate()`)
- `pm.building`: Unique identifier for each property address (randomly generated via `uuid::UUIDgenerate()`)
- `LandlordG`: Unique identifier for each landlord group identified by Pew's landlord dataset (anonymized) (randomly generated via `uuid::UUIDgenerate()`)

# Description of variables in `docket_defendant_outcomes.csv`

423,172 observations. 19 variables.    

- `defendantID` - Number of defendant in docket entry (first defendant = D1, second defendant = D2, etc...)
- `complaint` - Text entered along with the 'complaint' entry in the docket (contains scheduled hearing date and time)
- `complaintDate` - Date complaint entered into docket
- `outcome` - Outcome of case at the first disposition entered into docket
- `details` - Details of `outcome` entered into docket
- `outcomeDate` - Date `outcome` entered into docket
- `outcome_final` - Outcome of case at the last disposition entered into docket
- `details_final` - Details of `outcome_final` entered into docket
- `outcomeDate_final` - Date `outcome_final` entered into docket
- `reopen_petition` - Was a reopening petition filed?
- `reopen_outcome` - Outcome of reopening petition.
- `zoom_hearing` - Was a zoom hearing requested?
- `writIssued` - Was a writ of possession issued?
- `writDate` - Date writ of possession issued.
- `aliasWritIssued` - Was an alias writ of possession issued?
- `aliasWritDate` - Date alias writ of possession issued?
- `aliasWritServed` - Was an alias writ of possession served to the defendant? (lockout eviction)
- `aliasWritServedDate` - Date alias writ of possession served.
- `id` - Unique identifier for each case to match to `summary_table_philadelphia.csv` (randomly generated via `uuid::UUIDgenerate()`)
